<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="http://training-static.linesno.com/switch_run/favicon.ico" />
<title>资产管理系统 - 企业级统一化开发平台</title>

<link href="http://training-static.linesno.com/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="http://training-static.linesno.com/sb-admin/css/sb-admin.css" rel="stylesheet">
<link href="http://training-static.linesno.com/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="http://training-static.linesno.com/vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">

</head>

<body>
	<div class="container-fluid">
		<br />
		<div class="row">
			<!-- 
				<div class="col-4">1 of 3</div>
				 -->
			<div class="col-12">
				<form id="modifyForm" enctype="multipart/form-data">
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">姓名</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="name" placeholder="姓名">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">登陆名</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="loginName"
								placeholder="登陆名">
						</div>
					</div>

					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">密码</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="password"
								placeholder="密码">
						</div>
					</div>

					<div class="form-group row">
						<div class="col-sm-2">所属角色</div>
						<div class="col-sm-10">
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="rolePower"
									id="inlineRadio2" value="0" checked="checked"> <label
									class="form-check-label" for="inlineRadio2">管理员</label>
							</div>
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="rolePower"
									id="inlineRadio3" value="1"> <label
									class="form-check-label" for="inlineRadio3">租户</label>
							</div>
						</div>
					</div>

					<div class="form-group row">
						<div class="col-sm-2">菜单权限</div>
						<div class="col-sm-10">
							<div class="form-check form-check-inline"
								th:each="m:${resources}">
								<input name="resources" th:value="${m.id}"
									class="form-check-input" type="checkbox" id="gridCheck1">
								<label class="form-check-label" for="gridCheck1"
									th:text="${m.name}"></label>
							</div>
						</div>
					</div>

					<div class="form-group row">
						<label class="col-sm-2 col-form-label"
							for="exampleFormControlSelect1">数据权限</label>
						<div class="col-sm-10">
							<select class="form-control" name="masterCode">
								<option value="0">全区</option>
								<option th:each="m:${schools}" th:value="${m.masterCode}"
									th:text="${m.masterName}"></option>
							</select>
						</div>
					</div>

					<br />
					<button type="button" onclick="save()"
						class="btn btn-primary btn-lg btn-block">保存</button>
				</form>
			</div>
		</div>
	</div>

	<script src="http://training-static.linesno.com/vendor/jquery/jquery.min.js"></script>
	<script src="http://training-static.linesno.com/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
	<script src="http://training-static.linesno.com/layer/layer.js"></script>
	<script src="http://training-static.linesno.com/js/jquery.form/jquery.form.js"></script>

	<script type="text/javascript">
		var options = {
			url : "/manager/account_add_save",
			type : "post",
			success : successfun,
			dataType : "json",
			timeout : 3000
		};

		function save() {
			$('#modifyForm').ajaxSubmit(options);
		}

		function successfun(response, status) {
			layer.msg(response.message);
		}

		function preview(file) {
			var prevDiv = document.getElementById('preview');
			if (file.files && file.files[0]) {
				var reader = new FileReader();
				reader.onload = function(evt) {
					prevDiv.innerHTML = '<img style="width: 80px; height: 80px; margin-top: 10px; border-radius: 5px;" src="' + evt.target.result + '" />';
				}
				reader.readAsDataURL(file.files[0]);
			} else {
				prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
			}
		}
	</script>

</body>
</html>
